<?php
class CommentModel extends Model
{
	public function getCmtInfo()
	{
		$pageNum=isset($_GET['pageNum'])?$_GET['pageNum']:1;
		$rowsPrePage=$GLOBALS['conf']['Page']['rowsPrePage'];
		$offset=($pageNum-1)*$rowsPrePage;
		$sql="select c.*,a.title from bg_comment as c left join bg_article as a on c.art_id=a.art_id order by c.cmt_time desc limit $offset,$rowsPrePage";
		return $this->dao->fetchAll($sql);
	}
	public function getCmtsCount()
	{
		$sql="select count(*) from bg_comment";
		return $this->dao->fetchColumn($sql);
	}
}